Changes the shape of the collision square at (x, y) in the current room - turn a flat floor into a ramp while the game runs, or a ramp back into a flat floor with SHAPE_FULL. The class (solid, low cover, pass) and the flags of the square are left as they are.
Works differently on Game Boy - tile_set_shape works as on the Advance, up to 16 squares of a room at once, for a shape your game already uses (in a room, or by its SHAPE_ name); anything else does nothing, and nothing tells you.
Works differently on Game Boy Color - tile_set_shape works as on the Advance, up to 16 squares of a room at once, for a shape your game already uses (in a room, or by its SHAPE_ name); anything else does nothing, and nothing tells you.
On other consoles this differs: see Side by side and How the consoles differ.
tile_set_shape(x, y, shape)| Name | Type |
|---|---|
x | real |
y | real |
shape | int |
Nothing.
Changes the shape of the collision square at (x, y) in the current room. Turn a flat floor into a ramp while the game runs, or turn a ramp back into a flat floor with SHAPE_FULL. The shape is a number: SHAPE_FULL (0), one of the slope names such as SHAPE_45_FLOOR_UP_RIGHT, or a number from 128 up for a shape you drew yourself. The Slopes page lists them all.
x and y are a place in the room, counted from the room's top-left corner. The whole 8 by 8 square changes, not just the pixel you named.
The class of the square (TILE_PASS, TILE_SOLID or TILE_LOW_COVER) and its flags stay as they were, so a square that was solid is still solid, only now in the shape you gave it. To make an open square into a ramp, set its class to TILE_SOLID too, with tile_set_class.
Collision only - this never changes what is drawn. The ramp blocks the walker like a ramp, but it still looks like whatever picture is there. Pair it with tile_set_index, which repaints the square.
(x, y) is outside the room.tile_set_class has.shape is not a number a shape has: 0, 1 to 28, or 128 up as far as you have drawn shapes of your own.Changes are not saved and do not persist across a room change or a save and load. The room starts again with the shapes it was drawn with.
if (tile_class(x + 16, y + 8) == TILE_SOLID) {
tile_set_shape(x + 16, y + 8, SHAPE_45_FLOOR_UP_RIGHT);
}Looks at the square just ahead of the walker and, if it is solid, cuts it into a 45 degree ramp rising to the right.
A no-op if the current room has no collision tile layer, if (x, y) is outside it, if the layer is larger than the number of squares the engine can change while the game runs (the same limit as tile_set_class), or if shape is not a number a shape has (0, 1 to 28, or 128 up as far as the project has drawn its own). It changes what the square blocks and nothing about how it looks: draw the ramp too (tile_set_index). Like tile_set_class, a change is not saved and does not persist across a room change.